{% extends "base_en.html" %}
{% block content %}
<script type="text/javascript" src="/static/javascripts/xms_en.js"></script>
    <ins>{%if show_incomes%}Incomes{%endif%}{%if show_payouts%}Payouts{%endif%} : {{details.count}} items!
    <br/></ins>
    {% include 'pager_en.html' %}
    <table class="datalist" cellpadding="2" cellspacing="0">
    <tr>
      <th style="width:120px;"><span>Date</span></th>
      <th style="width:60px;"><span>Money</span></th>
      <th style="width:100px;"><span>Name</span></th>
      <th><span>Description</span></th>
      {%if show_incomes%}
      <th style="width:100px;"><span>Submitter</span></th>
      {%endif%}
      {%if show_payouts%}
      <th style="width:50px;"><span>Paid?</span></th>
      <th style="width:100px;"><span>Approver</span></th>
      {%endif%}
      {%if isAdmin%}
      <th style="width:50px;"><span>Action</span></th>
      {%endif%}
    </tr>
    {% for item in details.entries %}
    <tr class={%if forloop.counter0|divisibleby:2 %}"alternation"{%else%}"seperation"{%endif%}>
      <td>{{item.Datetime|date:"Y-m-d" }}</td>
      <td>{{item.Money|floatformat:2}}</td>
      <td>{{item.User.NickName|escape}}</td>
      <td><span>{{item.Details|escape}}</span></td>
      {%if show_incomes%}
      <td>{{item.Submiter.NickName|escape}}</td>
      {%endif%}
      {%if show_payouts%}
      <td><input type="checkbox" {%if item.IsPay %}checked="checked"{%endif%} disabled="disabled"/>
      {%if item.IsPay%}Yes{%else%}No{%endif%}
      </td>
      <td>
      {%if item.IsPay%}
      {{item.Approver.NickName|escape}}
      {%endif%}
      </td>
      {%endif%}
      {%if isAdmin%}
        <td>
        {%if show_incomes%}
        <a href="/groupaction/delincome/{{item.key}}/">Delete</a>
        {%endif%}
        {%if show_payouts%}
        <a href="/groupaction/delpayout/{{item.key}}/">Delete</a>
        {%endif%}
        </td>
      {%endif%}
    </tr>
    {% endfor %}
    </table>

{% endblock %}
